home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
ctlib100.zip
/
INSTALL.LZH
/
CTLISTBX.INT
< prev
next >
Wrap
Text File
|
1996-10-12
|
6KB
|
159 lines
{**************************************************************************}
{* BitSoft Development, L.L.C. *}
{* Copyright (C) 1992 Borland International, Inc. All rights reserved. *}
{* Portions Copyright (C) 1995, 1996 BitSoft Development, L.L.C. *}
{* All rights reserved. *}
{* Distributed with permission from Borland International, Inc. *}
{* Turbo Vision Containers ListBox Unit *}
{* Version 2.2.3 *}
{**************************************************************************}
unit ctListBx;
{$X+}
interface
uses Objects, Drivers, Views,
Containr, ctTypes;
const
VChars : TScrollChars = (#30, #31, #177, #254, #178);
HChars : TScrollChars = (#17, #16, #177, #254, #178);
type
PImsScrollBar = ^TImsScrollBar;
TImsScrollBar = object(TView)
Value : LongInt;
Min : LongInt;
Max : LongInt;
PgStep : LongInt;
ArStep : LongInt;
constructor Init (var Bounds : TRect);
constructor Load (var S : TStream);
procedure Clicked; virtual;
procedure Draw; virtual;
procedure DrawPos (Pos : LongInt); virtual;
function GetPalette : PPalette; virtual;
function GetPos : LongInt; virtual;
function GetSize : LongInt; virtual;
procedure HandleEvent (var Event : TEvent); virtual;
procedure ScrollDraw; virtual;
function ScrollStep (Part : LongInt) : LongInt; virtual;
procedure SetChars (AChars : TScrollChars); virtual;
procedure SetParams (AValue, AMin, AMax, APgStep, AArStep : LongInt);
virtual;
procedure SetRange (AMin, AMax : LongInt); virtual;
procedure SetStep (APgStep, AArStep : LongInt); virtual;
procedure SetValue (AValue : LongInt); virtual;
procedure Store (var S : TStream); virtual;
private
Chars : TScrollChars;
end; { TImsScrollBar }
type
PImsListViewer = ^TImsListViewer;
TImsListViewer = object(TView)
HScrollBar : PImsScrollBar;
VScrollBar : PImsScrollBar;
NumCols : LongInt;
TopItem : LongInt;
Focused : LongInt;
Range : LongInt;
Min : LongInt;
constructor Init (var Bounds : TRect; ANumCols : Word; AHScrollBar,
AVScrollBar : PImsScrollBar);
constructor Load (var S : TStream);
procedure ChangeBounds (var Bounds : TRect); virtual;
procedure Draw; virtual;
procedure FocusItem (Item : LongInt); virtual;
procedure FocusItemNum (Item : LongInt); virtual;
function GetPalette : PPalette; virtual;
function GetText (Item : LongInt; MaxLen : Word) : String; virtual;
function IsSelected (Item : LongInt) : Boolean; virtual;
procedure HandleEvent (var Event : TEvent); virtual;
procedure NewHScrollBar (AHScrollBar : PImsScrollBar); virtual;
procedure NewVScrollBar (AVScrollBar : PImsScrollBar); virtual;
procedure SelectItem (Item : LongInt); virtual;
procedure SetMin (AMin : LongInt); virtual;
procedure SetRange (ARange : LongInt); virtual;
procedure SetState (AState : Word; Enable : Boolean); virtual;
procedure Store (var S : TStream);
private
Start : LongInt;
end; { TImsListViewer }
type
PSequenceListBox = ^TSequenceListBox;
TSequenceListBox = object(TImsListViewer)
List : PSequence;
constructor Init (var Bounds : TRect; ANumCols : Word; AVScrollBar :
PImsScrollBar);
constructor Load(var S: TStream);
function DataSize : Word; virtual;
procedure DeleteFocusedItem; virtual;
procedure DeleteItem (Item : Integer); virtual;
procedure FreeAll; virtual;
procedure FreeFocusedItem; virtual;
procedure FreeItem (Item : Integer); virtual;
procedure GetData (var Rec); virtual;
function GetFocusedItem : Pointer; virtual;
function GetText (Item : LongInt; MaxLen : Word) : String; virtual;
procedure HandleEvent (var Event : TEvent); virtual;
procedure Insert (Item : Pointer); virtual;
procedure NewList (AList : PSequence); virtual;
procedure SetData (var Rec); virtual;
procedure SetFocusedItem (Item : Pointer); virtual;
procedure SetRange (ARange : LongInt); virtual;
procedure Store (var S : TStream);
end; { TSequenceListBox }
type
PSequenceListBoxRec = ^TSequenceListBoxRec;
TSequenceListBoxRec = record
List : PSequence;
Selection : LongInt;
end; { TSequenceListBoxRec }
type
PSortedSequenceListBox = ^TSortedSequenceListBox;
TSortedSequenceListBox = object(TSequenceListBox)
SearchPos : LongInt;
constructor Init (Bounds : TRect; ANumCols : Word; AVScrollBar :
PImsScrollBar);
constructor Load (var S : TStream);
function GetKey (var S : String) : Pointer; virtual;
procedure HandleEvent (var Event : TEvent); virtual;
end; { TSortedSequenceListBox }
const
RImsScrollBar: TStreamRec = (
ObjType : idImsScrollBar;
VmtLink : Ofs(TypeOf(TImsScrollBar)^);
Load : @TImsScrollBar.Load;
Store : @TImsScrollBar.Store);
RImsListViewer: TStreamRec = (
ObjType : idImsListViewer;
VmtLink : Ofs(TypeOf(TImsListViewer)^);
Load : @TImsListViewer.Load;
Store : @TImsListViewer.Store);
RSequenceListBox : TStreamRec = (
ObjType : idSequenceListBox;
VmtLink : Ofs(TypeOf(TSequenceListBox)^);
Load : @TSequenceListBox.Load;
Store : @TSequenceListBox.Store);
RSortedSequenceListBox : TStreamRec = (
ObjType : idSortedSequenceListBox;
VmtLink : Ofs(TypeOf(TSortedSequenceListBox)^);
Load : @TSortedSequenceListBox.Load;
Store : @TSortedSequenceListBox.Store);
procedure RegisterListBoxes;
implementation
end.